The Atiyah-Patodi-Singer (APS) index theorem relates the index of a Dirac operator to an integral of the Pontryagin density in the bulk (which is equal to global chiral anomaly) and an η invariant on the boundary (which defines the parity anomaly). We show that the APS index theorem holds for configurations with domain walls that are defined as surfaces where background gauge fields have discontinuities.